use mtdb
GO

DROP TABLE OBJ_UNIQUE_TS
GO

CREATE TABLE OBJ_UNIQUE_TS
(
    TENANT_ID NUMERIC(7,0) NOT NULL,
    OBJ_DEF_ID VARCHAR(128) NOT NULL,
    COL_NAME VARCHAR(36) NOT NULL,
    OBJ_ID VARCHAR(64) NOT NULL,
    VAL DATETIME2(3)
)
ON PS_MTDB (TENANT_ID)
GO

CREATE UNIQUE INDEX OBJ_UNIQUE_TS_INDEX1 ON OBJ_UNIQUE_TS (TENANT_ID, OBJ_DEF_ID, COL_NAME, VAL)
GO

CREATE INDEX OBJ_UNIQUE_TS_INDEX2 ON OBJ_UNIQUE_TS (TENANT_ID, OBJ_DEF_ID, OBJ_ID)
GO
